<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                                 xmlns:h="http://java.sun.com/jsf/html"
                                 xmlns:f="http://java.sun.com/jsf/core"
                                 xmlns:ui="http://java.sun.com/jsf/facelets"
                                 xmlns:p="http://primefaces.org/ui"
                                 template="/templates/ui.xhtml">
    <ui:define name="head">
        <link type="text/css" href="#{request.contextPath}/UI/epss/epss.css" rel="stylesheet"/>
        <script type="text/javascript" src="#{request.contextPath}/UI/support/pub.js"/>
        <script type="text/javascript" language="javascript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.tagName != 'BUTTON')
                        event.keyCode = 9;
                    else
                        event.srcElement.click();
                }
            }
        </script>
    </ui:define>
    <ui:define name="content">
        <h:form id="form">
            <p:growl id="msgs" showDetail="false"/>
            <h:panelGrid id="pgCondition" style="width: 100%">
                <h:panelGrid columns="8">
	                <h:outputLabel for="noItemHieRelap" value="编号:" />
	                <h:inputText id="noItemHieRelap"
	                             value="#{cttDTkAction.rowCttD.strNo}"
	                             style="background-color:gainsboro;"
	                             readonly="true">
	                </h:inputText>
	                <h:outputLabel for="name" value="名称:" />
	                <h:inputText id="name" value="#{cttDTkAction.rowCttD.name}"
	                             style="background-color:gainsboro;"
	                             readonly="true"/>
	                <h:outputLabel for="note" value="备注内容:" />
	                <h:inputText id="note" value="#{cttDTkAction.rowCttD.note}"
	                                 style="background-color:gainsboro;"
	                                 readonly="true"/>
	                <h:outputLabel for="unitItemInfo" value="单位:"/>
	                <h:inputText id="unitItemInfo" value="#{cttDTkAction.rowCttD.unit}"
	                             style="background-color:gainsboro;"
	                             readonly="true"/>
	                <h:outputLabel for="contractUnitPriceItemInfo" value="合同单价:"/>
	                <h:inputText id="contractUnitPriceItemInfo"
	                             value="#{cttDTkAction.rowCttD.contractUnitPrice}"
	                             style="background-color:gainsboro;text-align:right;"
	                             readonly="true" >
	                    <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
	                </h:inputText>
	                <h:outputLabel for="contractQuantityItemInfo" value="合同数量:"/>
	                <h:inputText id="contractQuantityItemInfo"
	                             value="#{cttDTkAction.rowCttD.contractQuantity}"
	                             style="background-color:gainsboro;text-align:right;"
	                             readonly="true">
	                    <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
	                </h:inputText>
	                <h:outputLabel for="contractAmountItemInfo" value="合同金额:"/>
	                <h:inputText id="contractAmountItemInfo"
	                             value="#{cttDTkAction.rowCttD.contractAmount}"
	                             style="background-color:gainsboro;text-align:right;"
	                             readonly="true">
	                    <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
	                </h:inputText>
	                <h:outputLabel for="originFlagItemInfo" value="数据来源:" />
	                <h:inputText id="originFlagItemInfo"
	                             value="#{commonAction.originFlagListValueOfAlias(
	                                             cttDTkAction.rowCttD.originFlag)}"
	                             style="background-color:gainsboro"
	                             readonly="true"/>
	                <h:outputLabel for="createdByItemInfo" value="创建人:" />
	                <h:inputText id="createdByItemInfo" value="#{cttDTkAction.rowCttD.createdByName}"
	                             style="background-color:gainsboro"
	                             readonly="true"/>
	                <h:outputLabel for="createdDateItemInfo" value="创建时间:" />
	                <h:inputText id="createdDateItemInfo" value="#{cttDTkAction.rowCttD.createdDate}"
	                             style="background-color:gainsboro"
	                             readonly="true"/>
	                <h:outputLabel for="lastUpdByItemInfo" value="修改人:" />
	                <h:inputText id="lastUpdByItemInfo" value="#{cttDTkAction.rowCttD.lastUpdByName}"
	                             style="background-color:gainsboro"
	                             readonly="true"/>
	                <h:outputLabel for="lastUpdDateItemInfo" value="修改时间:" />
	                <h:inputText id="lastUpdDateItemInfo" value="#{cttDTkAction.rowCttD.lastUpdDate}"
	                             style="background-color:gainsboro"
	                             readonly="true"/>
	                <h:outputLabel for="modificationNumItemInfo" value="修改次数:" />
	                <h:inputText id="modificationNumItemInfo" value="#{cttDTkAction.rowCttD.modificationNum}"
	                             style="background-color:gainsboro;text-align:right;"
	                             readonly="true">
	                    <f:convertNumber type="number" pattern="#,###,###,###,##0"/>
	                </h:inputText>
	            </h:panelGrid>
            </h:panelGrid>
            <p:ajaxStatus style="width:16px;height:16px;">
                <f:facet name="start">
                    <h:graphicImage value="/images/ajaxloading.gif"/>
                </f:facet>
                <f:facet name="complete">
                    <h:outputText value=""/>
                </f:facet>
            </p:ajaxStatus>
            <p:dataTable id="ptt" style="width:100%;"
                         value="#{cttDTkAction.rowCttDList}"
                         var="record"
                         rowKey="#{record.pkid}"
                         selection="#{cttDTkAction.rowCttDSelected}"
                         selectionMode="single"
                         paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks}
                         {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                         paginator="true"
                         paginatorPosition="bottom"
                         rows="15"
                         rowsPerPageTemplate="500,200,90,45,30,15"
                         rowIndexVar="row"
                         emptyMessage="数据记录为空..."
                         rowStyleClass="#{record.name eq '合计'? 'rowDoneStyle':
                         record.name eq '总合计'? 'rowDoneStyle':null}"
                         scrollable="true"
                         scrollHeight="400">
                <p:ajax event="rowSelect" listener="#{cttDTkAction.onRowSelect}" update=":form:pgCondition"/>
                <p:column style="width:30px" headerText="序号">
                    <h:outputText value="#{row + 1}"/>
                </p:column>
                <p:column style="width:120px" headerText="编号">
                    <h:outputText value="#{record.strNo}" escape="false"/>
                </p:column>
                <p:column style="width:360px" headerText="名称">
                    <h:outputText value="#{record.name}" />
                </p:column>
                <p:column style="width:30px" headerText="单位">
                    <h:outputText value="#{record.unit}" style="text-align:right"/>
                </p:column>
                <p:column style="width:80px" headerText="合同单价">
                    <h:outputText value="#{record.contractUnitPrice}" style="float: right" >
                        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                    </h:outputText>
                </p:column>
                <p:column style="width:80px" headerText="合同数量">
                    <h:outputText value="#{record.contractQuantity}" style="float: right">
                        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                    </h:outputText>
                </p:column>
                <p:column style="width:80px" headerText="合同金额">
                    <h:outputText value="#{record.contractAmount}" style="float: right">
                        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                    </h:outputText>
                </p:column>
                <p:column style="width:300px" headerText="备注">
                    <h:outputText value="#{record.note}" />
                </p:column>
            </p:dataTable>
        </h:form>
    </ui:define>
</ui:composition>